package siar.rmi;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.RemoteException;

import javax.xml.rpc.ServiceException;

import siar.webservice.ServicosSIARLocator;

public class ServidorRMI {
	public static void main(String args[]) {
		try {
			java.rmi.registry.LocateRegistry.createRegistry(1099);
			ServicosSIARLocator locator = new ServicosSIARLocator();
			ServicosSIAR_RMI rmi = new ServicosSIAR_RMI();
			rmi.objetoWS = locator.getServicosSIARSoap(); 
			Naming.rebind("servicosSIAR", rmi);
			System.out.println("Servidor RMI pronto.");
		} catch (RemoteException e) {
			e.printStackTrace();
		} catch (ServiceException e) {
			e.printStackTrace();
		} catch (MalformedURLException e) {
			e.printStackTrace();
		}
	}
}
